package edu.spec.lyq.week08.class2.home;

/**
 * \* User: 11028
 * \* Date: 2018/10/21
 * \* Time: 20:03
 * \* Description:
 */
public abstract class Animal {
    private String name;  //姓名
    private String food;  //主食
    private String area;  //地区
    public Animal(){}
    //通过参数初始化全部属性；
    public Animal(String name, String food, String area) {
        this.name = name;
        this.food = food;
        this.area = area;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setFood(String food) {
        this.food = food;
    }

    public void setArea(String area) {
        this.area = area;
    }

    public String getName() {
        return name;
    }

    public String getFood() {
        return food;
    }

    public String getArea() {
        return area;
    }

    //抽象方法，返回值类型String，方法名 findFood，即觅食，该方法是抽象方法；
    public  abstract String findFood();
    //返回值类型String，方法名eat，即进食，方法体返回“name吃food”，name和food替换成相应的值
    public String eat(){
        return (this.name + "吃" + this.food);
    }
    //抽象方法，返回值类型String，方法名wholeLife，即动物的一生，方法体的实现见5）
    public abstract String wholeLife();

}
